package com.bstek.uflo.form.command;

import java.util.List;

import com.bstek.uflo.command.Command;
import com.bstek.uflo.env.Context;
import com.bstek.uflo.form.model.TableColumn;

/**
 * @author Jacky.gao
 * @since 2013年11月7日
 */
public class QueryTableColumnCommand implements Command<List<TableColumn>> {
	private Long tableId;
	public QueryTableColumnCommand(Long tableId){
		this.tableId=tableId;
	}
	@SuppressWarnings("unchecked")
	public List<TableColumn> execute(Context context) {
		String hql="from "+TableColumn.class.getName()+" where tableId=:tableId order by id desc";
		return context.getSession().createQuery(hql).setLong("tableId", tableId).list();
	}
}
